<template>
  <br>
  <h3 style="color: red"><strong>{{title}}</strong></h3> <br>
  {{computeDataSize}}
  <button @click="addData">add 6</button>

<!-- 计算属性与方法函数的区别??????? -->

</template>

<script>
export default {
  name: "Demo",
  data(){
    return{
      title:"15.计算属性",
      data:[1,2,3,4]
    }
  },
  computed:{
    computeDataSize(){
      return this.data.length
    }
  },
  methods:{
    addData(){
      this.data.push(6);
    }
  }
}
</script>

<style scoped>

</style>